$(document).ready(function() {
	// 选择省
	$("#province").change(function() {
		setCity($(this).val());

		setArea($("#city").val());
	});

	// 选择城市
	$("#city").change(function() {
		setArea($(this).val());
	});
});

/**
 * 设置城市
 * 
 * @param province
 */
function setCity(province) {
	if (province == '' || province == 0) {
		$("#city").html("<option value=\"0\">请选择</option>");
		return;
	}

	$.ajax({
		type : "POST",
		url : "/Ajax/getCity/",
		data : "province=" + province,
		success : function(html) {
			$("#city").html(html);
		}
	});
}

/**
 * 设置区
 * 
 * @param city
 */
function setArea(city) {
	if (city == '' || city == 0) {
		$("#area").html("<option value=\"0\">请选择</option>");
		return;
	}

	$.ajax({
		type : "POST",
		url : "/Ajax/getArea/",
		data : "city=" + city,
		success : function(html) {
			$("#area").html(html);
		}
	});
}